.class public final Lcom/burstly/lib/util/Utils$DebugWrapper;
.super Ljava/lang/Object;
.source "Utils.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/burstly/lib/util/Utils;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "DebugWrapper"
.end annotation


# static fields
.field private static final BYTES_IN_KB:I = 0x400


# instance fields
.field private final mLogTag:Ljava/lang/String;


# direct methods
.method private constructor <init>(Ljava/lang/String;)V
    .locals 0
    .parameter "logTag"

    .prologue
    .line 288
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 289
    iput-object p1, p0, Lcom/burstly/lib/util/Utils$DebugWrapper;->mLogTag:Ljava/lang/String;

    .line 290
    return-void
.end method

.method public static getDebugger(Ljava/lang/String;)Lcom/burstly/lib/util/Utils$DebugWrapper;
    .locals 1
    .parameter "logTag"

    .prologue
    .line 299
    new-instance v0, Lcom/burstly/lib/util/Utils$DebugWrapper;

    invoke-direct {v0, p0}, Lcom/burstly/lib/util/Utils$DebugWrapper;-><init>(Ljava/lang/String;)V

    return-object v0
.end method


# virtual methods
.method public logAll()V
    .locals 0

    .prologue
    .line 319
    invoke-virtual {p0}, Lcom/burstly/lib/util/Utils$DebugWrapper;->logNativeHeap()V

    .line 320
    invoke-virtual {p0}, Lcom/burstly/lib/util/Utils$DebugWrapper;->logJavaHeap()V

    .line 321
    return-void
.end method

.method public logJavaHeap()V
    .locals 10

    .prologue
    const-wide/16 v8, 0x400

    const/4 v7, 0x1

    const/4 v6, 0x0

    .line 327
    sget-boolean v2, Lcom/burstly/lib/constants/Constants;->IS_DEBUG_MODE:Z

    if-eqz v2, :cond_0

    .line 328
    invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;

    move-result-object v0

    .line 329
    .local v0, currentRuntime:Ljava/lang/Runtime;
    const-string v2, " - Dalvik max heap size: %d KB"

    new-array v3, v7, [Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/Runtime;->maxMemory()J

    move-result-wide v4

    div-long/2addr v4, v8

    invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    aput-object v4, v3, v6

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    .line 330
    .local v1, log:Ljava/lang/String;
    invoke-static {}, Lcom/burstly/lib/util/Utils;->access$000()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v2

    iget-object v3, p0, Lcom/burstly/lib/util/Utils$DebugWrapper;->mLogTag:Ljava/lang/String;

    new-array v4, v6, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v1, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 331
    const-string v2, " - Dalvik heap size: %d KB"

    new-array v3, v7, [Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/Runtime;->totalMemory()J

    move-result-wide v4

    div-long/2addr v4, v8

    invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    aput-object v4, v3, v6

    invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    .line 332
    invoke-static {}, Lcom/burstly/lib/util/Utils;->access$000()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v2

    iget-object v3, p0, Lcom/burstly/lib/util/Utils$DebugWrapper;->mLogTag:Ljava/lang/String;

    new-array v4, v6, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v1, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 334
    .end local v0           #currentRuntime:Ljava/lang/Runtime;
    .end local v1           #log:Ljava/lang/String;
    :cond_0
    return-void
.end method

.method public logNativeHeap()V
    .locals 9

    .prologue
    const-wide/16 v7, 0x400

    const/4 v6, 0x1

    const/4 v5, 0x0

    .line 306
    sget-boolean v1, Lcom/burstly/lib/constants/Constants;->IS_DEBUG_MODE:Z

    if-eqz v1, :cond_0

    .line 307
    const-string v1, " - Native heap size: %d KB"

    new-array v2, v6, [Ljava/lang/Object;

    invoke-static {}, Landroid/os/Debug;->getNativeHeapSize()J

    move-result-wide v3

    div-long/2addr v3, v7

    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    aput-object v3, v2, v5

    invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    .line 308
    .local v0, log:Ljava/lang/String;
    invoke-static {}, Lcom/burstly/lib/util/Utils;->access$000()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v1

    iget-object v2, p0, Lcom/burstly/lib/util/Utils$DebugWrapper;->mLogTag:Ljava/lang/String;

    new-array v3, v5, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v0, v3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 309
    const-string v1, " - Native heap allocated size: %d KB"

    new-array v2, v6, [Ljava/lang/Object;

    invoke-static {}, Landroid/os/Debug;->getNativeHeapAllocatedSize()J

    move-result-wide v3

    div-long/2addr v3, v7

    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    aput-object v3, v2, v5

    invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    .line 311
    invoke-static {}, Lcom/burstly/lib/util/Utils;->access$000()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v1

    iget-object v2, p0, Lcom/burstly/lib/util/Utils$DebugWrapper;->mLogTag:Ljava/lang/String;

    new-array v3, v5, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v0, v3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 313
    .end local v0           #log:Ljava/lang/String;
    :cond_0
    return-void
.end method
